package com.cloud.commana.web;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.cloud.commana.ser.IUploadService;
import com.cloud.util.base.BaseAction;
import com.cloud.util.base.RetType;

/**
 * 文件上传
 * @author gaof
 * @date 2017年2月6日
 */
@Controller
@RequestMapping("common")
public class UploadAction extends BaseAction{

	@Resource(name="uploadService")
	private IUploadService uploadService;
	
	@ResponseBody
	@RequestMapping(value = "uploadFile.idop")
	public RetType uploadFile(@RequestParam MultipartFile[] file, HttpServletRequest request){

		RetType retType = uploadService.uplaodFile(file, request);
		
		return retType;
	}
	
}
